#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
using namespace std;

int main()
{
	int n; cin >> n;
	vector<int> arr(n);
	for (auto& e : arr) cin >> e;
	sort(arr.begin(), arr.end(), greater<int>());
	queue<int> q;
	q.push(arr.front());
	for (int i = 1; i < n; i++) {
		q.push(q.front());
		q.pop();
		q.push(arr[i]);
	}
	stack<int> ans;
	while (q.size()) {
		ans.push(q.front());
		q.pop();
	}
	int jug = 0;
	while (ans.size()) {
		if (jug) cout << ' '; jug = 1;
		cout << ans.top();
		ans.pop();
	}
	return 0;
}